package com.bumptech.glide.load;

import com.bumptech.glide.load.engine.Resource;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;

public class MultiTransformation<T>
  implements Transformation<T>
{
  private String id;
  private final Collection<? extends Transformation<T>> transformations;

  public MultiTransformation(Collection<? extends Transformation<T>> paramCollection)
  {
    if (paramCollection.size() < 1)
      throw new IllegalArgumentException("MultiTransformation must contain at least one Transformation");
    this.transformations = paramCollection;
  }

  @SafeVarargs
  public MultiTransformation(Transformation<T>[] paramArrayOfTransformation)
  {
    if (paramArrayOfTransformation.length < 1)
      throw new IllegalArgumentException("MultiTransformation must contain at least one Transformation");
    this.transformations = Arrays.asList(paramArrayOfTransformation);
  }

  public String getId()
  {
    if (this.id == null)
    {
      StringBuilder localStringBuilder = new StringBuilder();
      Iterator localIterator = this.transformations.iterator();
      while (localIterator.hasNext())
        localStringBuilder.append(((Transformation)localIterator.next()).getId());
      this.id = localStringBuilder.toString();
    }
    return this.id;
  }

  public Resource<T> transform(Resource<T> paramResource, int paramInt1, int paramInt2)
  {
    Object localObject = paramResource;
    Iterator localIterator = this.transformations.iterator();
    while (localIterator.hasNext())
    {
      Resource localResource = ((Transformation)localIterator.next()).transform((Resource)localObject, paramInt1, paramInt2);
      if ((localObject != null) && (!localObject.equals(paramResource)) && (!localObject.equals(localResource)))
        ((Resource)localObject).recycle();
      localObject = localResource;
    }
    return localObject;
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.bumptech.glide.load.MultiTransformation
 * JD-Core Version:    0.6.2
 */